package com.shareppy.nomrnaui.util;

import java.util.Date;

import android.text.format.DateFormat;

public class FormatUtils {

	public static final String dd_MMM_yyyy = "dd/MMM/yyyy";
	public static final String MMM_dd_yyyy = "MMM dd yyyy";
	public static final String MMMM = "MMMM";
	public static final String yyyy = "yyyy";
	public static final String yyyyMMdd = "yyyyMMdd";
	public static final String yyyyMMddHHmmss = "yyyyMMddHHmmss";
	public static final String yyyy_MM_dd_HH_mm_ss = "yyyy/MM/dd kk:mm:ss";

	private FormatUtils() {
		super();
	}

	/**
	 * Format a date on especified format
	 * 
	 * @param date
	 * @param format
	 * @return
	 */
	public static CharSequence formatDate(Date date, String format) {
		if (date == null) {
			return null;
		}
		return DateFormat.format(format, date);
	}

	public static CharSequence formatDatePicker(Date date) {
		return formatDate(date, dd_MMM_yyyy);
	}

	public static CharSequence formatDate(Date date) {
		return formatDate(date, MMM_dd_yyyy);
	}

	public static CharSequence formatMonth(Date date) {
		return formatDate(date, MMMM);
	}

	public static CharSequence formatYear(Date date) {
		return formatDate(date, yyyy);
	}

	public static CharSequence formatInt(Date date) {
		return formatDate(date, yyyyMMdd);
	}

	public static CharSequence formatLong(Date date) {
		return formatDate(date, yyyyMMddHHmmss);
	}

	public static CharSequence formatTimeStamp(Date date) {
		return formatDate(date, yyyy_MM_dd_HH_mm_ss);
	}
}